package com.muyu.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;

/**
 * @ClassName: RequestListener
 * @Author: Zirun.Xin
 * @Date: 2025/3/24 下午3:16
 * @Version: 1.0
 * @Description: 自定义请求监听器
 */
@Slf4j
@WebListener
public class RequestListener implements ServletRequestListener {

    /**
     * 请求初始化监听
     * @param sre Servlet请求事件对象
     */
    @Override
    public void requestInitialized(ServletRequestEvent sre) {
        log.info("【监听器工作】进入监听器");
    }

    /**
     * 请求销毁监听
     * @param sre Servlet请求事件对象
     */
    @Override
    public void requestDestroyed(ServletRequestEvent sre) {
        log.info("【监听器工作】销毁监听器");
    }
}
